home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Treccani Italiana Di Scienze Lettere Ed Arti
/
[Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso
/
mac
/
data
/
menu_dvd.swf
/
scripts
/
__Packages
/
CAppendiceStyleManager.as
< prev
next >
Wrap
Text File
|
2007-11-07
|
3KB
|
79 lines
class CAppendiceStyleManager extends AsBroadcaster
{
function CAppendiceStyleManager(inBaseFont, inApiceFont, inPediceFont, inNormalSize, inSmallSize, inBigSize)
{
super();
this.mCurrentView = "normal";
this.mBaseFont = inBaseFont;
this.mApiceFont = inApiceFont;
this.mPediceFont = inPediceFont;
this.mNormalSize = inNormalSize;
this.mSmallSize = inSmallSize;
this.mBigSize = inBigSize;
this.mMargin = 16;
this.mPrintMargin = 28;
this.mMarginTitle = 0;
this.mPreviewMargin = 16;
this.mPreviewMarginTitle = 16;
this.mPreviewNormalSize = this.mNormalSize - 1;
this.mPreviewSmallSize = this.mSmallSize - 1;
this.mPreviewBigSize = this.mBigSize - 1;
this.mPrintSize = inNormalSize;
this.init();
}
function SetView(inView)
{
if(inView != this.mCurrentView)
{
this.mCurrentView = inView;
if(this.mCurrentView == "big")
{
this.initStyle(this.mCSS,this.mBigSize,this.mMargin,this.mMarginTitle);
this.initStyle(this.mPreviewCSS,this.mPreviewBigSize,this.mPreviewMargin,this.mPreviewMarginTitle);
}
else if(this.mCurrentView == "small")
{
this.initStyle(this.mCSS,this.mSmallSize,this.mMargin,this.mMarginTitle);
this.initStyle(this.mPreviewCSS,this.mPreviewSmallSize,this.mPreviewMargin,this.mPreviewMarginTitle);
}
else
{
this.initStyle(this.mCSS,this.mNormalSize,this.mMargin,this.mMarginTitle);
this.initStyle(this.mPreviewCSS,this.mPreviewNormalSize,this.mPreviewMargin,this.mPreviewMarginTitle);
}
trace("Setting new css" + inView);
this.broadcastMessage("onFontSizeChanged");
}
}
function init()
{
this.mCSS = new TextField.StyleSheet();
this.initStyle(this.mCSS,this.mNormalSize,this.mMargin,this.mMarginTitle);
this.mPrintCSS = new TextField.StyleSheet();
this.initStyle(this.mPrintCSS,this.mPrintSize,this.mPrintMargin,this.mPrintMargin);
this.mPreviewCSS = new TextField.StyleSheet();
this.initStyle(this.mPreviewCSS,this.mPreviewNormalSize,this.mPreviewMargin,this.mPreviewMarginTitle);
AsBroadcaster.initialize(this);
trace("USE_EMBEDDED_FONT = " + CAppendiceStyleManager.USE_EMBEDDED_FONT);
HtmlListboxCellRenderer.USE_EMBEDDED_FONT = CAppendiceStyleManager.USE_EMBEDDED_FONT;
HtmlTreeCellRenderer.USE_EMBEDDED_FONT = CAppendiceStyleManager.USE_EMBEDDED_FONT;
HtmlMenuCellRenderer.USE_EMBEDDED_FONT = CAppendiceStyleManager.USE_EMBEDDED_FONT;
HtmlListboxCellRenderer.style_sheet = this.GetCSS();
HtmlTreeCellRenderer.style_sheet = this.GetCSS();
HtmlMenuCellRenderer.style_sheet = this.GetCSS();
EmbedHtmlMenuCellRenderer.style_sheet = this.GetCSS();
}
function GetPreviewCSS()
{
return this.mPreviewCSS;
}
function GetPrintCSS()
{
return this.mPrintCSS;
}
function GetCSS()
{
return this.mCSS;
}
}